<?php if (!defined('BASEPATH'))  exit('No direct script access allowed');

define( 'RESOURCES_SVG'    ,  './uploaded_res/');
define( 'PROJECTS_PATH'  , './projects/');
define( 'CURRENT_PATH'   , PROJECTS_PATH.'current/');
define( 'IMG_LOGO_PATH'   , CURRENT_PATH.'ressources/img/logo/');
define( 'HISTORY_PATH'   , PROJECTS_PATH.'history/');
define( 'RESOURCES_PATH' , PROJECTS_PATH.'resources/'); // ls fichier SVG prevenant du fichier zip
define( 'ATTACHMENTS_PATH' , CURRENT_PATH.'ressources/attachments/');
define( 'IMAGE_PATH' , CURRENT_PATH.'ressources/img/slides/');
define( 'SLUG' , 'atlantisdigit');



function css($file_path){
    if( !is_array($file_path) )
        $file_path = array($file_path);
    
        for( $i=0 ; $i < count( $file_path ) ; $i++)
         echo '<link rel="stylesheet" type="text/css" href="'.base_url( 'assets/'.$file_path[$i] ).'.css" media="screen">'."\n";
}
function js($file_path){
       if( !is_array($file_path) )
        $file_path = array($file_path);
        for( $i=0 ; $i < count( $file_path ) ; $i++)
            echo '<script type="text/javascript" src="'.base_url( 'assets/'.$file_path[$i] ).'.js" ></script>'."\n";
}
/**
 * 
 * @param string     $path_img
 * @param assoc table $params
 * 
 */
function img($path_img , $params = null){
    $img = '<img src="'.base_url( 'assets/images/'.$path_img ).'" ';
    if( $params != null)
        if(is_array($params))
            foreach ($params as $key=>$value)
                $img .= ' '.$key.'="'.$value.'" ';
        $img .= " >";
        echo $img;
}


function script( $path )
{
    if( !is_array($path))
        $path = array($path);
    $ret ="";
    foreach ($path as $l)
        $ret  .= '<script type="text/javascript" src="'.base_url( 'assets/'.$l ).'.js" ></script>'."\n";
    return $ret;
}